home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 11
/
Amoszine 11 (Disk 2 of 2).adf
/
Ben_Wyatt_Source.lha
/
Funnyizer.AMOS
/
Funnyizer.amosSourceCode
Wrap
AMOS Source Code
|
2004-04-12
|
2KB
|
79 lines
' Funnyizer
' ~~~~~~~~~
' by Ben Wyatt, bwyatt@paston.co.uk
'
' Can create funny words out of totally boring ones. Honest!
Screen Open 0,640,256+56*Ntsc,2,Hires
Screen Display 0,128,37,640,256+56*Ntsc
Palette $0,$FFF
Dim NORM$(6),ABNORM$(18)
Global NORM$(),ABNORM$()
For N=1 To 18
Read ABNORM$(N)
Next N
For N=1 To 6
Read NORM$(N)
Next N
Data "B","C","D","F","G","H","J","K","L","M"
Data "N","P","R","S","T","V","W","Z"
Data "A","E","I","O","U","Y"
Print "Funnyizer"
Print "~~~~~~~~~"
Print "Type in a normal English word and I'll funnyize it"
Print "Input nothing for the last word typed in"
Print "Ctrl C to Quit"
Print
Repeat
Input "A Normal Word:";B$
If B$<>""
A$=B$
Else
Cup : Print "A Normal Word:";A$
End If
_FUNNYIZE[A$]
If A$<>"" Then Print " Funnyized:";Param$
Print
Until 0=1
End
Procedure _FUNNYIZE[A$]
' Funnyize A$ and return the new version in Param$
A$=Upper$(A$)
If Len(A$)<2
' Too short
Print "Sorry, But I Prefer Longer Words" : A$=""
Else
C$=A$
Repeat
For N=2 To Len(A$)
If Rnd(1)=1 and Mid$(A$,N,1)<>" "
' Get single character
M$=Mid$(A$,N,1)
' See if it matches any of the letters
For M=1 To 6
If NORM$(M)=M$ : B$=NORM$(Rnd(5)+1) : End If
Next M
For M=1 To 18
If ABNORM$(M)=M$ : B$=ABNORM$(Rnd(17)+1) : End If
Next M
' Change letter to new one
Mid$(A$,N,1)=B$
End If
Next N
Until C$<>A$
' Put first character in upper case and the rest in lower
A$=Upper$(Left$(A$,1))+Lower$(Right$(A$,Len(A$)-1))
End If
End Proc[A$]